# Humm and Strumm Video Game
# Copyright (C) 2008-2012, the people listed in the AUTHORS file. 
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Dist.cmake -- Defines several targets to aid in creating distributable
# packages.

if (CPACK_COMMAND)
  include (CPackSetup)
  
  # TARGET: dist
  # Create the specified distributable packages.
  add_custom_target(dist
    COMMAND ${CMAKE_COMMAND} -E copy ${hummstrumm_BINARY_DIR}/ChangeLog
                                     ${hummstrumm_SOURCE_DIR}/ChangeLog
    COMMAND ${CMAKE_MAKE_PROGRAM} package_source
    COMMAND ${CMAKE_COMMAND} -E remove ${hummstrumm_SOURCE_DIR}/ChangeLog)
  add_dependencies (dist changelog)
  set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
    ${hummstrumm_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.tar.gz
    ${hummstrumm_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.zip)
endif (CPACK_COMMAND)